#ifndef _INETADDRESS_H
#define _INETADDRESS_H
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

using std::string;

class InetAddress {
public: 
    InetAddress(const string & ip, unsigned short port);
    InetAddress(const struct sockaddr_in & addr);
    string ip();
    unsigned short port();
    struct sockaddr_in * getInetAddressPtr();
    ~InetAddress();
private:
    struct sockaddr_in _addr;
};

#endif //_INETADDRESS_H
